// import { Home, Login, Register } from '../pages';
import { lazy } from 'react'
import { Switch, Route, Redirect } from 'react-router-dom'
// import loadable from '@loadable/component'
// import Loadable from 'react-loadable';
// import loadable from ''

import AsyncLoadable from '../utils/AsyncLoadable'

const Home = AsyncLoadable(() => import('../pages/home'))
const Login = AsyncLoadable(() => import('../pages/login'))
const Register = AsyncLoadable(() => import('../pages/register'))
const About = AsyncLoadable(() => import('../pages/about'))

const RouterView = () => {
	return (
		<Switch>
			<Route path="/login" component={Login}></Route>
			<Route path="/register" component={Register}></Route>
			<Route path="/home" component={Home}></Route>
			<Route path="/about" component={About}></Route>

			<Redirect from="/" to="/login" />
		</Switch>
	)
}

export default RouterView
